﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Xml.Serialization;

namespace ELab.Serialization.Data
{
    [XmlRoot("Answers")]
    [Serializable]
    public class Answer : IELabSerializable
    {
        [XmlElement("IsRightAnwer")]
        public bool IsRightAnwer { get; set; }
        [XmlElement("AnswerValue")]
        public string AnswerValue { get; set; }

        public void Serialize(IELabSerializer serializer)
        {
            serializer.WriteBoolean(IsRightAnwer);
            serializer.WriteStringUTF8(AnswerValue);
        }

        public void Deserialize(IELabDeserializer deserializer)
        {
            IsRightAnwer = deserializer.ReadBoolean();
            AnswerValue = deserializer.ReadStringUTF8();
        }
    }
}
